package by.wind.drebedengi.datalayer;

import java.util.HashMap;

public class DeleteObject  extends AbstractAction {

	public static final String SOAP_ACTION = "deleteObject";
	public static final String METHOD_NAME = "deleteObject";
	
	public static final String CATEGORY = "object";
    public static final String CHANGE = "change";
    public static final String CURRENCY = "currency";
    public static final String INCOME = "income";
    public static final String INCOME_SOURCE = "object";
    public static final String MOVE = "move";
    public static final String OBJECT = "object";
    public static final String PLACE = "object";
    public static final String TAG = "tag";
    public static final String WASTE = "waste";
    
    private final String POSITIVE ="1";
	
	private boolean result;
	private String type;
	private long id;
	
	public DeleteObject(long l, String type) {
		this.id = l;
		this.type = type;
	}
	
	@Override
	public void loadData() throws Exception{
		HashMap<String, Object> propertyList = new HashMap<String, Object>();
		propertyList.put(Constants.API_ID_KEY, Constants.API_ID_VALUE);
		propertyList.put(Constants.LOGIN_KEY, Constants.LOGIN_VALUE);
		propertyList.put(Constants.PASS_KEY, Constants.PASS_VALUE);
		
		propertyList.put(Constants.ID, id);
		propertyList.put(Constants.TYPE, type);
		try {
			result = false;
			Object itsData =  loadData(METHOD_NAME, SOAP_ACTION, propertyList);
			result = true;
		} 
		catch(Exception ex) {
			ex.printStackTrace();
		}
	}

	public boolean getResult() {
		return result;
	}
}
